<template>
	<!-- ai创作提示 -->
	<view class="ai-write-tips" v-if="tips.show">
		<view class="tips-title">
			<text>{{ tips.title }}</text>
			<u-icon name="close" size="14" color="#999" @click="handleTipClose()"></u-icon>
		</view>
		<view class="tips-content">{{ tips.content }}</view>
		<view class="tips-copy" @click="handleTipCopy()">
			<image src="@/static/copy.png" />
			应用
		</view>
	</view>
</template>

<script>
export default {
    props: {
        tips: {
            type: Object,
            default: () => {
                return {
                    show: false,
                    title: '',
                    content: ''
                };
            }
        },
        // 影响字段
        type: {
            type: String,
            default: ''
        }
    },
    methods: {
        handleTipClose() {
            this.$emit('close', this.type);
        },
        handleTipCopy() {
            this.$emit('copy', this.type);
            this.handleTipClose();
        }
    }
};
</script>

<style lang="scss">
.ai-write-tips {
	width: calc(100% - 100rpx);
	background-color: #fff8f3;
	border: solid 1px #f1780054;
    margin: 0 auto;
	margin-bottom: 20rpx;
	padding: 20rpx 40rpx;
	border-radius: 25rpx;
	display: flex;
	flex-direction: column;
	gap: 20rpx;
	color: #333;

	.tips-title {
		font-size: 32rpx;
		font-weight: bold;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.tips-content {
		font-size: $font-size-base;
		color: #666;
		gap: 10rpx;
	}

	.tips-copy {
		display: flex;
		align-items: center;
		gap: 10rpx;
		font-size: $font-size-base;
		color: $theme-color;

		image {
			width: 32rpx;
			height: 32rpx;
		}
	}
}
</style>
